use serde::Deserialize;
use validator::Validate;

/// =========    登录参数    ========
#[derive(Debug, Deserialize, Validate)]
pub struct AuthcUsernameLoginParams {
    #[validate(length(min = 1, message = "用户名不得为空"))]
    pub username: String,
    #[validate(length(min = 1, message = "密码不得为空"))]
    pub password: String,
}

#[derive(Debug, serde::Serialize)]
pub struct AuthcUsernameLoginResponse {
    pub sessionid: String,
    pub username: String,
    #[serde(rename = "displayName")]
    pub display_name: String,
}
